<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLogEverydayDatasTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('log_everyday_datas', function (Blueprint $table) {
            $table->increments('id');
            $table->date('date_time')->comment('日期');
            $table->tinyInteger('type')->comment('类型:1全服,2渠道,3区服');
            $table->integer('server_id')->default(0)->comment('区服ID');
            $table->integer('channel_id')->default(0)->comment('渠道ID');
            $table->integer('new_player_num')->comment('新增账号');
            $table->integer('new_role_num')->comment('新增角色');
            $table->integer('login_player_num')->comment('登录人数DAU');
            $table->double('amount', 8, 2)->comment('充值金额');
            $table->integer('pay_player_num')->comment('充值人数');
            $table->string('pay_player_ratio')->comment('付费率');
            $table->integer('new_player_pay_num')->comment('新用户付费人数');
            $table->double('new_player_amount', 8, 2)->comment('新用户付费金额');
            $table->float('new_player_ltv')->comment('新用户首日ltv');
            $table->integer('old_player_pay_num')->comment('老用户付费人数');
            $table->double('old_player_amount', 8, 2)->comment('老用户付费金额');
            $table->integer('online_max_num')->default(0)->comment('最高在线人数');
            $table->integer('online_min_num')->default(0)->comment('最少在线人数');
            $table->integer('online_avg_num')->default(0)->comment('平均在线人数');
            $table->float('arpu')->comment('arpu值');
            $table->float('arppu')->comment('arppu值');
            $table->float('active_arpu')->comment('活跃arpu');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('log_everyday_datas');
    }
}
